package com.heavenick.core.model;

import java.util.Map;

import com.heavenick.core.util.MapUtil;

public abstract class PersistentView implements IDataObject {

	private static final long serialVersionUID = 3103811907426062825L;

	@Override
	@SuppressWarnings("rawtypes")
	public String toString() {
		StringBuffer sb = new StringBuffer("{");
		Map iMap = MapUtil.populateMap(this);
		for (Object obj : iMap.keySet()) {
			sb.append(obj).append(":").append(iMap.get(obj)).append(",");
		}
		return sb.substring(0, sb.length()-1) + "}";
	}
	
	@SuppressWarnings("rawtypes")
	public Map toMap(){
		return MapUtil.populateMap(this);
	}
}
